<#define __LAMPATH__="{{LAM.classPath}}" />
<#define __SERVER__="{{LAM.SERVER}}" />
<#define __INDEX__="{{LAM.INDEX}}" />
<#define __CSS__="{{LAM.CSS}}" />
<#define __PLUGINS__="{{LAM.PLUGINS}}" />
<#define __CLASSPATH__="{{LAM.classPath}}" />

#define# __DATA__ <#include repeat="0" tp-data="{}"  file="__SERVER__/sorts/index" /> #end#



<#extends title="类别" data="{'list':[
{'name':'类别','href':'###','title':''},
{'name':'类别列表','href':'###','title':''},
{'name':'类别列表'}
]}" />

<#beginBlock id="crumb" data="{'list':[
{'name':'类别','href':'###','title':''},
{'name':'类别列表','href':'###','title':''},
{'name':'类别列表'}
]}">
<#endBlock>


<#Block:begin id="child" data="{'list':[{'id':0,'name':'name','child':[]}]}">
<%LAM.each(list,function(i){%>
		<%if(System.isArray(this.child)){%>
			<li>
				<div class="btn mt5">
			        <span><%=this.name%></span>
			        <a href="__INDEX__sorts/edit&id=<%=this.id%>&pid=<%=this.pid%>" target="_blank">修改</a>
			        <a data-type="delete" href="javascript:void(0)" data-url="__INDEX__sorts/delete&id=<%=this.id%>">删除</a>
			    </div>
				<ul class="ml10"><%=LAM.Template.getBlock('child',{list:this.child})%></ul>
			</li>
	    <%}else{%>
	    	<li class="mt5">
	    		<div class="btn">
			        <span><%=this.name%></span>
			        <a href="__INDEX__sorts/edit&id=<%=this.id%>&pid=<%=this.pid%>" target="_blank">修改</a>
			        <a data-type="delete" href="javascript:void(0)" data-url="__INDEX__sorts/delete&id=<%=this.id%>">删除</a>
			    </div>
	    	</li>
	    <%}%>
<%});%>
<#Block:end>


<#Block:begin id="sorts_list" data="{'list':[{'id':0,'name':'name','child':[]}]}">
<%LAM.each(list,function(i){%>
<div class="L mr5 mb10 sectionButton-B1 sectionButton-B1-big" data-id="<%=this.id%>">
	<div class="btn">
        <span><%=this.name%></span>
        <a href="__INDEX__sorts/edit&id=<%=this.id%>&pid=<%=this.pid%> target="_blank">修改</a>
        <a data-type="delete" href="javascript:void(0)" data-url="__INDEX__sorts/delete&id=<%=this.id%>">删除</a>
    </div>
	<%if(System.isArray(this.child)){%>
		<ul class="ml10"><%=LAM.Template.getBlock('child',{list:this.child})%></ul>
    <%}%>
</div>
<%});%>
<#Block:end>

<#=block id="sorts_list" data="{'list':__DATA__}" />
<script type="text/javascript">
	LAM.run([jQuery],function($){
		$(function(){
			$(document).on('click', '[data-type="delete"]', function () {
                var $this = $(this);
                layer.confirm('真的要删除吗？？？', {icon: 3, title:'提示'}, function(index){
                  //do something
                  System.redirect($this.data('url'));
                  layer.close(index);
                });

            });
		});
	});
</script>
<style type="text/css">
    .sectionButton-B1 .btn{}
    .sectionButton-B1 .btn a{color:#fff;}

</style>